home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / Updates / PowerPC / pdflib / configure.in < prev    next >
Text File  |  2000-05-16  |  21KB  |  738 lines

  1. dnl Configure.in script for PDFlib.
  2. dnl Process this file with autoconf to produce a configure script.
  3.  
  4. dnl source directory sanity check using an arbitrary source file
  5. AC_INIT(pdflib/p_basic.c)
  6.  
  7. VERSION="2.01"
  8.  
  9. WITH_CXX=nope
  10. WITH_JAVA=nope
  11. WITH_PERL=nope
  12. WITH_PYTHON=nope
  13. WITH_TCL=nope
  14.  
  15. dnl install-sh will be searched (and found) here
  16. AC_CONFIG_AUX_DIR(util)
  17.  
  18. # Set name for machine-dependent library files
  19. AC_SUBST(MACHDEP)
  20. AC_MSG_CHECKING(MACHDEP)
  21. if test -z "$MACHDEP"
  22. then
  23.     if test -f /usr/lib/NextStep/software_version; then
  24.         set X `hostinfo | grep 'NeXT Mach.*:' | \
  25.             sed -e 's/://' -e 's/\./_/'` && \
  26.         ac_sys_system=next && ac_sys_release=$4
  27.         MACHDEP="$ac_sys_system$ac_sys_release$ac_sys_cpu"
  28.     else
  29.         ac_sys_system=`uname -s`
  30.         if test "$ac_sys_system" = "AIX" ; then
  31.             ac_sys_release=`uname -v`
  32.         else
  33.             ac_sys_release=`uname -r`
  34.         fi
  35.         ac_md_system=`echo $ac_sys_system |
  36.                    tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
  37.         ac_md_release=`echo $ac_sys_release |
  38.                    tr -d '[/ ]' | sed 's/\..*//'`
  39.         MACHDEP="$ac_md_system$ac_md_release"
  40.     fi
  41.     case MACHDEP in
  42.     '')    MACHDEP=unknown;;
  43.     esac
  44. fi
  45. AC_MSG_RESULT($MACHDEP)
  46.  
  47. # Default defines -- some systems may need special handling here
  48.  
  49. case $ac_sys_system/$ac_sys_release in
  50.     cyg*|CYG*) DEFINES="-U_WIN32 -UWIN32 -U__WIN32__ -U_Windows";;
  51.     *)    DEFINES="";;
  52. esac
  53.  
  54. # ---------- Checks for programs.
  55.  
  56. AC_PROG_CC
  57. AC_PROG_CPP
  58. AC_PROG_INSTALL
  59. AC_PROG_RANLIB
  60.  
  61. # ---------- deselect C++ option
  62. WITH_CXX="yes"
  63. AC_ARG_WITH(cxx,[  --without-cxx               Disable C++ test program],
  64.     [WITH_CXX="no"],
  65.     [WITH_CXX="yes"])
  66.  
  67. if test "$WITH_CXX" = "yes"; then
  68.     AC_PROG_CXX
  69.     AC_SUBST(CXX)
  70. fi
  71.  
  72. # common stuff, unlikely to be changed
  73. SHELL="/bin/sh"
  74.  
  75. # EXE must include the dot if used
  76. case $ac_sys_system/$ac_sys_release in
  77.     cyg*|CYG*) EXE=".exe";;
  78.     *)    EXE="";;
  79. esac
  80.  
  81. # OBJ must _not_ include the dot
  82. OBJ="o"
  83. AR="ar rc"
  84. RM="rm -f"
  85.  
  86. AC_SUBST(SHELL)
  87. AC_SUBST(EXE)
  88. AC_SUBST(OBJ)
  89. AC_SUBST(AR)
  90. AC_SUBST(VERSION)
  91. AC_SUBST(CC)
  92. AC_SUBST(RM)
  93.  
  94. # ---------- Checks for libraries.
  95.  
  96. # This borrowed from the Python configuration file
  97. # Set info about shared libraries.
  98.  
  99. AC_SUBST(SO)
  100. AC_SUBST(LDSHARED)
  101. AC_SUBST(CCSHARED)
  102. AC_SUBST(LINKFORSHARED)
  103.  
  104. # SO is the extension of shared libraries `(including the dot!)
  105. # -- usually .so, .sl on HP-UX
  106.  
  107. AC_MSG_CHECKING(SO)
  108. if test -z "$SO"
  109. then
  110.     case $ac_sys_system/$ac_sys_release in
  111.     hp*|HP*) SO=.sl;;
  112.     NeXT/3*|next/3*) SO=.a;; # no shared libs on NeXT 3.3 and less
  113.     cyg*|CYG*) SO=.dll;;
  114.     *)    SO=.so;;
  115.     esac
  116. fi
  117. AC_MSG_RESULT($SO)
  118. # LDSHARED is the ld *command* used to create shared library
  119. # -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5
  120. AC_MSG_CHECKING(LDSHARED)
  121. if test -z "$LDSHARED"
  122. then
  123.     case $ac_sys_system/$ac_sys_release in
  124.     AIX*) LDSHARED="ld_so_aix";;
  125.     IRIX*) LDSHARED="ld -shared";;
  126.     SunOS/4*) LDSHARED="ld";;
  127.     SunOS/5*) LDSHARED="ld -G";;
  128.     hp*|HP*) LDSHARED="ld -b";;
  129.     OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";;
  130.     DYNIX/ptx*) LDSHARED="ld -G";;
  131.     Linux*) LDSHARED="gcc -shared";;
  132.     FreeBSD*) LDSHARED="ld -Bshareable";;
  133.     NetBSD*) LDSHARED="ld -Bshareable -Bdynamic -x";;
  134.     NeXT|next/3*) LDSHARED="ld -u libsys_s";;
  135.     NeXT|next/4*) LDSHARED="cc -nostdlib -r ";;
  136.     SCO_SV*) LDSHARED="ld -G";;
  137.     cyg*|CYG*) LDSHARED="dllwrap --export-all --driver-name gcc --output-def libpdf$VERSION.def --implib libpdf$VERSION.a ";;
  138.     *)    LDSHARED="ld";;
  139.     esac
  140. fi
  141. AC_MSG_RESULT($LDSHARED)
  142.  
  143. # CCSHARED are the C *flags* used to create objects to go into a shared
  144. # library -- this is only needed for a few systems
  145. AC_MSG_CHECKING(CCSHARED)
  146. if test -z "$CCSHARED"
  147. then
  148.     case $ac_sys_system in
  149.     hp*|HP*) if test "$GCC" = yes;
  150.          then CCSHARED="-fpic";
  151.          else CCSHARED="+z";
  152.          fi;;
  153.     Linux*) CCSHARED="-fpic";;
  154.     SCO_SV*) CCSHARED="-Kpic -belf";;
  155.     FreeBSD*) CCSHARED="-fpic";;
  156.     NetBSD*) CCSHARED="-fpic";;
  157.     cyg*|CYG*) CCSHARED="-DBUILDING_DLL=1";;
  158.     esac
  159. fi
  160. AC_MSG_RESULT($CCSHARED)
  161.  
  162. # ---------- select debugging configuration
  163. WITH_DEBUG="no"
  164. AC_ARG_WITH(debug,[  --with-debug                Enable debugging configuration (implies static)],[WITH_DEBUG="yes"], [WITH_DEBUG="no"])
  165.  
  166. # ---------- select static library (shared is default for most systems)
  167. # Filter systems which don't support shared libraries
  168. case $ac_sys_system/$ac_sys_release in
  169.     NeXT|next/3*) WITH_STATIC="no";;
  170.     *)    WITH_STATIC="yes";;
  171. esac
  172.  
  173. AC_ARG_WITH(static,[  --with-static               Enable building the static library],[WITH_STATIC="yes"], [WITH_STATIC="no"])
  174.  
  175. # LINKFORSHARED are the flags passed to the $(CC) command that links
  176. # the executables -- this is only needed for a few systems
  177.  
  178. AC_MSG_CHECKING(LINKFORSHARED)
  179. if test -z "$LINKFORSHARED"
  180. then
  181.     case $ac_sys_system/$ac_sys_release in
  182.     AIX*)    LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';;
  183.     hp*|HP*)
  184.         LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
  185.     Linux*) LINKFORSHARED="-Xlinker -export-dynamic";;
  186.     next/3*) LINKFORSHARED="-u libsys_s";;
  187.     SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
  188.     IRIX*/6*) LINKFORSHARED="-all";;
  189.     esac
  190. fi
  191. AC_MSG_RESULT($LINKFORSHARED)
  192.  
  193. # ---------- Checks for header files.
  194.  
  195. # The following tests for Tcl, Python, and Perl are taken from
  196. # the SWIG configure.in file, which in turns borrows some tests
  197. # from the Python configuration.
  198.  
  199. echo ""
  200. echo "Checking for installed languages."
  201. echo "Note: none of the following packages are required to build PDFlib"
  202. echo ""
  203.  
  204. #--------------------------------------------------------------------
  205. #    Take care of C++
  206. #--------------------------------------------------------------------
  207.  
  208. # Filter out systems where we don't build the C++ binding
  209. # Quote Detlev Droege: "C++ doesn't work with a real object-oriented
  210. # system such as NeXTStep"
  211.  
  212. case $ac_sys_system/$ac_sys_release in
  213.     NeXT|next/3*) WITH_CXX="no";;
  214.     NeXT|next/4*) WITH_CXX="no";;
  215.     *)    WITH_CXX="yes";;
  216. esac
  217.  
  218. #--------------------------------------------------------------------
  219. #    Try to locate the Java Developers Kit for JNI
  220. #--------------------------------------------------------------------
  221.  
  222. JAVAINCLUDE=nope
  223.  
  224. AC_ARG_WITH(java,[  --with-java=path            Set location of Java Developers Kit],[
  225.     JAVAPACKAGE="$withval"], [JAVAPACKAGE=nope])
  226.  
  227. if test "$JAVAINCLUDE" = nope; then
  228.    if test "$JAVAPACKAGE" != nope; then
  229.     JAVAINCLUDE="-I$JAVAPACKAGE/include"
  230.    fi
  231. fi
  232.  
  233. AC_MSG_CHECKING(for Java header files)
  234. if test "$JAVAINCLUDE" = nope; then
  235. AC_TRY_CPP([#include <jni.h>], , JAVAINCLUDE="nope")
  236. if test "$JAVAINCLUDE" = nope; then
  237.     dirs="$prefix /usr/lib/java /usr/java /usr/local/java /usr/lib/jdk1.2.1 /usr/lib/jdk1.1.8 /usr/lib/jdk1.1.7 /usr/lib/jdk1.1.6 /usr/lib/jdk1.1.5 /usr/lib/jdk1.1.4 /usr/lib/jdk1.1.3 /usr/local/jdk1.1.2 /usr/local/jdk1.1.1 /usr /opt/local"
  238.     for i in $dirs ; do
  239.         if test -r $i/include/jni.h; then
  240.             AC_MSG_RESULT($i/include)
  241.             JAVAINCLUDE="-I$i/include"
  242.             break
  243.         fi
  244.     done
  245. fi
  246. if test "$JAVAINCLUDE" = nope; then
  247.     JAVAINCLUDE="-I/usr/local/include"
  248.         AC_MSG_RESULT(not found)
  249. else
  250.     WITH_JAVA="yes"
  251.     if test -r $JAVAINCLUDE/$MACHDEP/jni_md.h; then
  252.         JAVAINCLUDE="$JAVAINCLUDE $JAVAINCLUDE/$MACHDEP"
  253.     else
  254.         JAVAINCLUDE="$JAVAINCLUDE $JAVAINCLUDE/genunix"
  255.     fi
  256. fi
  257. else
  258.         AC_MSG_RESULT($JAVAINCLUDE)
  259. fi
  260.  
  261. AC_SUBST(JAVAINCLUDE)
  262.  
  263. #--------------------------------------------------------------------
  264. #    Try to locate the Tcl package
  265. #--------------------------------------------------------------------
  266.  
  267. TCLINCLUDE=nope
  268. TCLPACKAGEDIR=nope
  269. TCLBIN=nope
  270.  
  271. AC_ARG_WITH(tcl,[  --with-tcl=path             Set location of Tcl executable],[TCLBIN="$withval"],[TCLBIN=nope])
  272.  
  273. AC_ARG_WITH(tclpkg,[  --with-tclpkg=path          Set location of Tcl package install directory],[TCLPACKAGEDIR="$withval"],[TCLPACKAGEDIR=nope])
  274.  
  275. AC_ARG_WITH(tclincl,[  --with-tclincl=path         Set location of Tcl include directory],[TCLINCLUDE="-I$withval"],[TCLINCLUDE=nope])
  276.  
  277. AC_MSG_CHECKING(for Tcl header files)
  278. if test "$TCLINCLUDE" = nope; then
  279. AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="nope")
  280. if test "$TCLINCLUDE" = nope; then
  281.     dirs="$prefix/include /usr/local/include /usr/include /opt/local/include /home/sci/local/include /usr/pkg/include"
  282.     for i in $dirs ; do
  283.         if test -r $i/tcl.h; then
  284.             AC_MSG_RESULT($i)
  285.             TCLINCLUDE="-I$i"
  286.             break
  287.         fi
  288.     done